[bits 32]

CRT_ADDR_REG equ 0x3D4
CRT_DATA_REG equ 0x3D5

CRT_CURSOR_H equ 0xE
CRT_CURSOR_L equ 0xF

section .text
global _inb
_inb:
    push ebp
    mov ebp, esp

    xor eax, eax
    mov edx, [ebp + 8]
    in al, dx

    jmp $ + 2
    jmp $ + 2
    jmp $ + 2

    leave
    ret

global _outb
_outb:
    push ebp
    mov ebp, esp

    mov edx, [ebp + 8]
    mov eax, [ebp + 12]
    out dx, al

    jmp $ + 2
    jmp $ + 2
    jmp $ + 2

    leave
    ret

global _inw
_inw:
    push ebp
    mov ebp, esp

    xor eax, eax
    mov edx, [ebp + 8]
    in ax, dx

    jmp $ + 2
    jmp $ + 2
    jmp $ + 2

    leave
    ret

global _outw
_outw:
    push ebp
    mov ebp, esp

    mov edx, [ebp + 8]
    mov eax, [ebp + 12]
    out dx, ax

    jmp $ + 2
    jmp $ + 2
    jmp $ + 2

    leave
    ret